// This is JDefenceTower, a simple tower defence style game
//
// Copyright (C) 2010 Maximilian Junker
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 3 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, see <http://www.gnu.org/licenses/>.

package junker.defence.ui;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.Rectangle2D;

import junker.defence.model.MapObject;

public class Sprite {
	private MapObject mo;
	private Rectangle2D.Float rect;

	public Sprite(MapObject mo){
		this.mo=mo;
		rect=new Rectangle2D.Float(0, 0, 1, 1);
	}
	
	public void draw(Graphics g) {
		Graphics2D g2d = (Graphics2D) g;
		if(mo.getMapObjectDescription().isBarrier()){
			g.setColor(Color.BLACK);
		} else g.setColor(Color.RED);
		rect.x = mo.getLocation().getX();
		rect.y = mo.getLocation().getY();
		g2d.fill(rect);
	}

}
